<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>js的注解函数传参和返回值提示</title>
  <style>
    *,
    *::after,
    *::before {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    :root {
      min-height: 100vh;
    }

    :root:focus-within {
      scroll-behavior: smooth;
    }

    body {
      min-height: inherit;
    }
  </style>
</head>

<body>
  <div></div>
</body>
<script>
  // https://mp.weixin.qq.com/s/3mkKWlsLnp-SnLw_s6MIcA
  "use strict"; {
    /**
     *
     * @since 2.0.0
     * @category Array
     * @param {Array<number>} arr 目标数组
     * @param {number} num 要搜索的下标
     * @returns {number} 如果找到就放该值，找不到就返回 -1
     * @see find, findIndex, findKey, findLast, findLastKey
     * @example
     *
     * 
    */
    let f = (arr, num) => {
      return arr[num] ?? -1
    }
    let arr = [10, 2, 3, 6]
    let num = 1
    console.log(f(arr, num))
  };
</script>

</html>